package com.example.service.impl;

import com.example.dao.CommentDao;
import com.example.dao.impl.CommentDaoImpl;
import com.example.service.CommentService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service("commentService")
public class CommentServiceImpl implements CommentService {
    @Resource(name = "commentDao")
    public CommentDao commentDao;
    public Integer insertComment(Integer tId,Integer uId,String content) {
        int res = commentDao.insertComment(tId,uId,content);
        if(res == 1) {
            return 200;
        } else {
            return 500;
        }
    }

    public List<Map<String,Object>> getUserCommentList(Integer uId) {
        return commentDao.getUserCommentList(uId);
    }
}
